/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*
*	Julio Montes e-mail: imc.coder@gmail.com
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef ALLIANCE_ENVARPANEL_H
#define ALLIANCE_ENVARPANEL_H

#include <wx/wx.h>
#include <wx/listctrl.h>
#include "sdk/include/filecfg.h"

namespace alliance
{
    class EnvarPanel : public wxPanel
    {
    public:
        EnvarPanel( wxWindow *parent, wxWindowID id );
        virtual ~EnvarPanel();
        void AddVariable( const wxString &name, const wxString &value );
        size_t GetVariables( sdk::multimapAttributes *variables );
    protected:
    private:
        void OnAdd( wxCommandEvent &evt );
        void OnRemove( wxCommandEvent &evt );
        void OnEdit( wxCommandEvent &evt );
        void OnNew( wxCommandEvent &evt );

        wxListCtrl *m_listCtrl;
        size_t m_index;
    };


    class ChooserVariablesDialog : public wxDialog
    {
    public:
        ChooserVariablesDialog( wxWindow *parent );
        virtual ~ChooserVariablesDialog();
        void GetVariable( wxString *name, wxString *value ) const;
    protected:
    private:
        void OnOk( wxCommandEvent &evt );
        void OnListBoxSelected( wxCommandEvent &evt );


        wxListBox *m_lbEnvironmentVariables;
        wxTextCtrl *m_tcVariableValue;
    };




    class NewVariableDialog : public wxDialog
    {
    public:
        NewVariableDialog( wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &name=wxEmptyString, const wxString &value=wxEmptyString );
        ~NewVariableDialog();

        void OnOk( wxCommandEvent &evt );

        void GetVariable( wxString *name, wxString *value ) const;
    protected:
    private:
        wxTextCtrl *tcVariable;
        wxTextCtrl *tcValue;
    };
}
#endif //ALLIANCE_ENVARPANEL_H
